package com.xmsit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xmsit.pojo.AdsConsumeStatLastMonth;
import com.xmsit.pojo.AdsMileageStatLastMonth;
import com.xmsit.service.AdsMileageStatLastMonthService;
import com.xmsit.mapper.AdsMileageStatLastMonthMapper;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
* @author 徐
* @description 针对表【ads_mileage_stat_last_month(里程相关统计)】的数据库操作Service实现
* @createDate 2025-04-18 22:09:09
*/
@Service
public class AdsMileageStatLastMonthServiceImpl extends ServiceImpl<AdsMileageStatLastMonthMapper, AdsMileageStatLastMonth>
    implements AdsMileageStatLastMonthService{

    @Override
    public List<AdsMileageStatLastMonth> getAdsMileageStatLastMonth(AdsMileageStatLastMonth adsMileageStatLastMonth) {
        LambdaQueryWrapper<AdsMileageStatLastMonth> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(AdsMileageStatLastMonth::getVin, adsMileageStatLastMonth.getVin());
        if(adsMileageStatLastMonth.getMon() != null) {
            queryWrapper.eq(AdsMileageStatLastMonth::getMon, adsMileageStatLastMonth.getMon());
        }
        List<AdsMileageStatLastMonth> list = list(queryWrapper);
        return list;
    }
}




